#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>

int maxProfit(int* prices, int pricesSize)
{
    int ret = 0;
    for (int i = 0; i < pricesSize; i++)
    {
        for (int j = i + 1; j < pricesSize; j++)
        {
            ret = fmax(ret, prices[j] - prices[i]);
        }
    }
    return ret;
}